package com.hzhr.iot.device.convertor.custom;

import com.hzhr.iot.device.convertor.DeviceMaintenanceCardItemConvertor;
import com.hzhr.iot.device.entity.ext.DeviceMaintenanceCardItemEntityExt;
import com.hzhr.iot.device.entity.ext.OptionsEntityExt;
import com.hzhr.iot.device.model.regulatorDevice_maintenanceCard_item.RegulatorDevice_MaintenanceCard_ItemModel;
import org.springframework.stereotype.Service;

@Service
public class DeviceMaintenanceCardItemCustomConvertor extends DeviceMaintenanceCardItemConvertor {


    @Override
    public RegulatorDevice_MaintenanceCard_ItemModel ext2regulatorDevice_MaintenanceCard_ItemModel(DeviceMaintenanceCardItemEntityExt in) {
        RegulatorDevice_MaintenanceCard_ItemModel result = super.ext2regulatorDevice_MaintenanceCard_ItemModel(in);
//        maintenanceItemExt_des
        OptionsEntityExt ex = in.getMaintenanceItemExt();
        if (ex != null){
            result.setMaintenanceItemDes(ex.getDes());
        }


        return result;

    }
}

